package com.declum.peyar.db;

import java.util.ArrayList;
import java.util.List;

public class Record {
	private List<String> addresses = null;
	private String name;

	public Record() {
		this.addresses = new ArrayList<String>();
	}

	public boolean addAddress(String address) {
		if (address == null) {
			return false;
		}
		if (address.trim().equals("")) {
			return false;
		}
		if (!this.isAddressFound(address)) {
			this.addresses.add(address);
			return true;
		}
		return false;
	}

	public String[] getAddresses() {
		return this.addresses.toArray(new String[] {});
	}

	public String getName() {
		return this.name;
	}

	public boolean isAddressFound(String address) {
		return this.addresses.contains(address);
	}

	public void removeAddress(String address) {
		this.addresses.remove(address);

	}

	public void setName(String name) {
		this.name = name;
	}
}
